package com.ltmall.api.manager.impl;

import com.ltmall.api.bean.ActivityPrice;
import com.ltmall.api.bean.Cart;
import com.ltmall.api.bean.ThSku;
import com.ltmall.api.dao.impl.CartDAO;
import com.ltmall.api.manager.CartManager;

import java.util.List;

public class CartManagerImpl implements CartManager {

    private CartDAO cDAO;

    public CartDAO getcDAO() {
        return cDAO;
    }

    public void setcDAO(CartDAO cDAO) {
        this.cDAO = cDAO;
    }

    public boolean addCart(Cart cart) {
        // TODO Auto-generated method stub		
        return cDAO.persist(cart);
    }

    public boolean updateNumber(int number, int cartID) {
        // TODO Auto-generated method stub
        return cDAO.setNumber(number, cartID);
    }

    public boolean delCart(int cartID) {
        // TODO Auto-generated method stub
        return cDAO.delCart(cartID);
    }

    public List<?> cartList(int userID, int shopID) {
        // TODO Auto-generated method stub
        return cDAO.cartList(userID, shopID);
    }

    public List<?> shopList(int userID) {
        // TODO Auto-generated method stub
        return cDAO.shopList(userID);
    }

    public int cartListCount(int userID) {
        // TODO Auto-generated method stub
        return cDAO.cartListCount(userID);
    }

    public List<?> shopAndgoodsList(int userID, int directID) {
        // TODO Auto-generated method stub
        return cDAO.shopAndgoodsList(userID, directID);
    }

    public Cart cartDetail(int cartID) {
        // TODO Auto-generated method stub
        return cDAO.cartDetail(cartID);
    }

    public boolean delCart(int goodsID, String goodsFormat, int userID) {
        // TODO Auto-generated method stub
        return cDAO.delCart(goodsID, goodsFormat, userID);
    }

    public boolean delCartBySkuID(int skuID, int userID) {
        return cDAO.delCartBySkuID(skuID, userID);
    }

    public Cart isGoodsExist(int goodsID, int userID, String goodsFormat) {
        // TODO Auto-generated method stub
        return cDAO.isGoodsExist(goodsID, userID, goodsFormat);
    }
    
    public Cart isGroupGoodsExist(int goodsID, int userID,String format, int directID) {
        return cDAO.isGroupGoodsExist(goodsID, userID,format, directID);
        
    }

    public boolean updateCart(int cartID, int number, String goodsFlavor) {
        // TODO Auto-generated method stub
        return cDAO.updateCart(cartID, number, goodsFlavor);
    }

    public ThSku goodsPrice(int goodsID, String format) {
        // TODO Auto-generated method stub
        return cDAO.getPrice(goodsID, format);
    }

    public ActivityPrice getActivityPrice(int goodsID, String goodsFormat) {
        // TODO Auto-generated method stub
        return cDAO.getActivityPrice(goodsID, goodsFormat);
    }

    public Cart isGoodsExist(int goodsID, int userID, int skuID, int activityID, String activityName) {
        // TODO Auto-generated method stub
        return cDAO.isGoodsExist(goodsID, userID, skuID, activityID, activityName);
    }

    public ActivityPrice panicSKuGet(int skuID, int activityID) {
        // TODO Auto-generated method stub
        return cDAO.panicSKuGet(skuID, activityID);
    }

    public List<?> ordersGet(int skuID, int userID, String activityName, int getActivityID) {
        // TODO Auto-generated method stub
        return cDAO.ordersGet(skuID, userID, activityName, getActivityID);
    }

    public ThSku skuGet(int skuID) {
        // TODO Auto-generated method stub
        return cDAO.skuGet(skuID);
    }
}
